{% extends "space/rest/index.html" %} 
{% block script %}
		$("#id_rest_cuis_type").mcDropdown("#id_cuis_typesmenu"); 
		$("#id_cuisine").mcDropdown("#cuisinemenu");
		$("#id_special").click(function() {
			if ($(this).attr("checked") == "checked") { 
			   $("#tr1").show();
			   $("#tr2").show();
			} else { 
			   $("#tr1").hide();
			   $("#tr2").hide();
			}
		}); 
{% endblock %}
{% block right_container %}



<div class="admin_position">商户管理 > 添加菜式</div>

<div class="admin_mer_zpc_ad">

	<form method="post" action="" name="restCuisTypeForm" enctype="multipart/form-data"
		id="restCuisTypeForm">
		<div class="admin_mer_newDish" >
     		<table class="zpc_ad_list"><tbody>
           <tr>
              <td colspan="3" class="admin_top_title">新增菜式</td>
           </tr>
           <tr>

              <td class="bg_left">新菜式图片：</td>
              <td>
              	{{form.img}}
                 <br>               
                 <span class="red3">选择本地图片上传，图片格式：jpg， 尺寸大小：400 x 400</span>
                 
              {% for error in form.img.errors %}{{error}}{%endfor %}</td>
           </tr>

           <tr>
              <td class="bg_left">新菜式名称：</td>
               <td >                 
                 {{form.name}}
              	{% for error in form.name.errors %}{{error}}{%endfor %}</td>
           </tr>
           <tr>
              <td class="bg_left">价格：</td>
              <td>
              	{{form.price}}元          
              {% for error in form.price.errors %}{{error}}{%endfor %}</td>
           </tr>
           <tr>              
              <td class="bg_left">菜式介绍：</td>
              <td >
				{{form.desc}}
              {% for error in form.desc.errors %}{{error}}{%endfor %}</td>
           </tr>
           <tr>
              <td class="bg_left">所属目录：</td>
              <td>
              	<ul id="id_cuis_typesmenu" class="mcdropdown_menu">
					{{rest_cuis_types|safe}}
				</ul>
				
				<input type="text" name="rest_cuis_type" id="id_rest_cuis_type" value="" />
              {% for error in form.rest_cuis_type.errors %}{{error}}{%endfor %}</td>
           </tr>
           <tr>
              <td class="bg_left">所属菜系：</td>
              <td>
              		<ul id="cuisinemenu" class="mcdropdown_menu">
						{% for cuisine in cuisines %}
							{% if cuisine.level == 1 %}
			                <li rel='{{cuisine.id}}'>{{cuisine.name}}
			                	{% if cuisine.cuisine_set.all %}
			                	<ul>
		                		{% for childcuisine in cuisine.cuisine_set.all %}
			                        <li rel='{{childcuisine.id}}'>{{childcuisine.name}}</li>
			                     {% endfor %} 
			                     </ul>
			                     {% endif %}   
			                </li>
			                {% endif %}
			             {% endfor %} 
					</ul>
				<input type="text" name="cuisine" id="id_cuisine" value="" />
              {% for error in form.cuisine.errors %}{{error}}{%endfor %}</td>
           </tr>
           
           <tr>

              <td class="bg_left">设置为招牌菜：</td>
              <td>{{form.special}}</td>
              <td class="red">{% for error in form.special.errors %}{{error}}{%endfor %}</td>
           </tr>
                   
          
         <!-- fuck sky-----------以下内容为当选择设置为招牌菜时显示------------->
         
          <tr style="display:none" id="tr1">
             <td class="bg_left">
               招牌菜图片广告
             </td>

             <td>            
             	{{form.sign_dish_img}}
              <br>
              <span class="red3">上传餐厅首页的招牌菜广告的轮换图片 格式为：jpg，尺寸为：700 x 200</span>
             </td>
           </tr>
           <tr  style="display:none" id="tr2">
             <td class="bg_left">
                填写招牌菜广告词
             </td>

             <td class="zpc_ggc">
             	{{form.sign_dish_ad}}
                <br>
                <span class="red3">填写图片轮换广告的招牌菜广告词</span>
             </td>
          </tr>
          </tbody></table>
          {{form.weight}}
          {{form.state}}
          <div class="center"><input type="submit" name="submit" value="确认上架"></div>

          </div>   
		{% csrf_token %}
	</form>

</div>

{% endblock %}
